﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Infrastructure.Model.DI;
using Model.EntityModel.Auth;
using Model.ResultModel;
using Repository.IRepository.ISysRepository;
using Service.IService.ISysService;

namespace Service.Service.SysService
{
    [AppService(ServiceType = typeof(IMenuService), ServiceLifetime = LifeTime.Scoped)]
    public class MenuService : IMenuService
    {
        private readonly IMenuRepository _menuRepository;

        public MenuService(IMenuRepository menuRepository)
        {
            _menuRepository = menuRepository;
        }

        public List<MenuResult> GetAllMenus()
        {
            return _menuRepository.GetAllMenus();

        }
        public List<MenuResult> GetMenusList()
        {
            return _menuRepository.GetMenusList();

        }
        

        public bool AddMenu(Menu enumeration)
        {
            enumeration.Id = 1;
            return _menuRepository.AddMenu(enumeration);
        }

        public bool EditMenu(Menu enumeration)
        {
            return _menuRepository.EditMenu(enumeration);
        }

        public int DeleteMenus(string[] ids)
        {
            return _menuRepository.DeleteList(ids);
        }

        public int AddMenus(List<Menu> enus)
        {
            throw new NotImplementedException();
        }
    }
}
